<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>图片文字居中对齐</title>
</head>
<style>
    img {
        /*vertical-align: bottom;*/
        vertical-align: middle;
    }
</style>
<body>
<!--图片和文字默认基线对齐-->
<img src="images/user.jpg"> This is a test
</body>
</html>